#ifndef EXPANDWIDGET_H
#define EXPANDWIDGET_H

#include "uwidget.h"

class UCollapseWidgetPrivate;
class UTKWIDGET_EXPORT UCollapseWidget : public UWidget
{
    Q_OBJECT
public:

    explicit UCollapseWidget(QWidget* parent = nullptr);
    ~UCollapseWidget();

    void setTitleText(const QString &text);

    void addItem(QWidget* widget);

    void clearItem();

    void setExpanded(bool isExpand);

    bool isExpanded();

signals:
    void expandChanged(bool isExpand);

protected:
    bool eventFilter(QObject *watched, QEvent *event) override;

private:
    QScopedPointer<UCollapseWidgetPrivate> d_ptr;
    Q_DISABLE_COPY(UCollapseWidget)
    Q_DECLARE_PRIVATE_D(d_ptr, UCollapseWidget)
};

#endif // EXPANDWIDGET_H
